package edu.predatorwars.server.host;

import java.util.UUID;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;

public class TimeoutJob implements Job {

	public void execute(JobExecutionContext arg0) throws JobExecutionException { 
		
		JobDetail detail = arg0.getJobDetail();
		JobKey theKey = detail.getKey();
		String name = theKey.getName();
		String group = theKey.getGroup();
		
		UUID snapshot = UUID.fromString(name);
		UUID gameId = UUID.fromString(group);
		
		//We will pass the gameId and boardSnapshot to the GameHost. If gameId's boardSnapshot is identical, then disconnect the player
		
		GameHostImpl.timeoutPlayer(snapshot, gameId);
		
	}

}
